<template>
  <div style="height: 100%">

    <div style="height: 100%">

      <!--    单篇文章-->
      <div class="single_article shadow" :style="'background-color:'+theme.secondaryBackground"
           v-for="the_article in the_article_lists"
           :key="the_article.id"
           @click=" toArticleDetails(the_article.aid)">
        <!--      标题-->
        <div align="center">
          <a href="" style="font-size: 2em;" :style="'color:'+theme.numberOneTextColor">
            {{the_article.theTitle}}</a>
        </div>
        <!--      简单数据-->
        <div align="center"
             style="font-size: 1.0em;color: #5f636c;padding-bottom: 5em;margin-top: 1em"
             :style="'color:'+theme.numberTwoFontColor">
          <i class="el-icon-time"/> {{the_article.updateTime}}
          <el-divider direction="vertical"/>
          <i class="el-icon-ice-cream-square"/> {{the_article.thumbUpFor}}
          <el-divider direction="vertical"/>
          神奇的数字: {{the_article.browseTheNumber}}
        </div>
        <!--      内容-->
        <div style="padding-bottom: 5em" :style="'color:'+theme.numberThreeFontColor">
          {{the_article.briefContent}}
        </div>
        <div align="center">

          <router-link :to="{
       path: '/theArticleDetails',
       query: {aid: the_article.aid}}" style="border-style: solid;
         border-width: 2px 2px;padding: 0.3em;
         margin-bottom: 2%"
                       :style="'color:'+theme.numberOneTextColor">
            查看全文>>
          </router-link>
        </div>
      </div>

    </div>

  </div>
</template>

<script>
  // eslint-disable-next-line no-unused-vars
  import marked from 'marked';

  export default {
    // name: "Index",
    data() {
      return {
        drawer: false,
        direction: 'rtl',
        the_footer_information: '酸牛来',
        site_title: 'concise-blog',
        site_subheading: '大鹏一日同风起,扶摇直上九万里',
        the_article_lists: [],
        recommended_articles_list: [],
        the_dark_theme_state: 0,
        the_dark_theme: '',
        home_page_height: {
          height: 0,
        },
        home_page_width: {
          width: 0,
        },


        theme: {},
      };
    },
     mounted() {
      // let that = this;

    },
    created() {
      const that = this;

      // 初始化系统
      that.theme = that.$store.getters.getTheme;

      that.$http.get(`${that.ARTICLE_API}/the-article-lists`).then((res) => {
        that.the_article_lists = res.data.result;
      });

      // 获取推荐文章
      // 2020年02月29日16:19:31   暂时取消推荐文章
      // 原因,界面太丑 😝
      // that.$http.get(that.ARTICLE_API + "/recommended-articles").then(function (res) {
      //   that.recommended_articles_list = res.data.result;
      // });
    },
    methods: {
      handleClose(done) {
        done();
      },
    },
  };


</script>

<style>

  /*单篇文章*/
  .single_article {
    background-color: #ffffff;
    padding: 3%;
    margin-bottom: 3%;
  }


  /*<!--首页图片-->*/
  .homepage_pictures {
    display: flex;
    align-items: center;
    background-image: url('http://img.blog.myjiandan.com/concise-blog/wallhaven-13x79v%20(1).jpg');
  }

  .transparent {
    background: #00000000;

  }

  .white {
    color: aliceblue;
  }

  .sideImg {
    position: relative;
    width: 100%;
    height: 200px;
    background-position: center center;
    background-size: cover;
  }

  .the_article_a {
    min-height: 50px;
    position: relative;
    height: 25em;
    width: 100%;
    /*box-shadow: 1em 1em 5em #aaa3ab;*/
    border-radius: 1em;
    margin-top: 1em;
    background-image: url('http://img.blog.myjiandan.com/concise-blog/wallhaven-13x79v%20(1).jpg')
  }

  .article_2 {
    /*padding: 1em 1em 1em 1em;*/
    margin-right: 1em;
    width: 100%;
    height: 50%;

    /*padding-left: 2em;*/
    border-radius: 0em 0em 1em 1em;
    position: absolute;
    bottom: 0;
    background-color: rgba(87, 87, 87, 0.69);
  }

  .article_list_title {
    font-size: 3em;
    padding-top: 3%;
    padding-bottom: 3%
  }

  .recommended_article_text_1 {
    /*padding: 1em 1em 1em 1em;*/
    margin-right: 1em;
    width: 100%;
    height: 25%;
    margin-left: 2em;
    /*padding-left: 2em;*/
    border-radius: 0em 0em 1em 1em;
    position: absolute;
    bottom: 0;
    /*background-color: rgba(113, 111, 195, 0.8);*/

  }

  /*首页标题*/
  .home_page_title {
    font-family: 宋体;
    font-weight: bold;
    font-size: 5em;
    color: aliceblue;
    width: 100%;
    margin-left: 5%;
  }

  /*首页小标题*/
  .home_title {
    color: aliceblue;
    margin-left: 5%;
  }

  /*文章小箭头*/
  .article_arrow {
    float: right;
    color: white;
    margin-top: 1em;
    margin-right: 1em
  }

  /*文章统计*/
  .this_article_statistics {
    /*width: 100%;*/
    background-color: #ffffff;
    position: absolute;
    border-radius: 0.5em;
    color: #59525a;
    bottom: 0;
    padding: 1% 3% 1% 3%;
    margin: 0 0 1em;
  }

  .recommend_the_title {
    font-weight: bold;
    font-size: 2em;
    margin-top: 2em;
  }

  .recommended_article_1 {
    min-width: 10em;
    min-height: 150px;
    position: relative;
    height: 20em;
    /*width: 100%;*/
    /*box-shadow: 0.1em 0.1em 1em #aaa3ab;*/
    border-radius: 1em;
    margin-top: 3em;
    background-image: url('http://img.blog.myjiandan.com/concise-blog/wallhaven-13x79v%20(1).jpg')
  }

  .home_recommendation_list1 {
    min-width: 10em;
    min-height: 150px;
    position: relative;
    height: 15em;
    /*width: 100%;*/
    /*box-shadow: 0.1em 0.1em 1em #aaa3ab;*/
    border-radius: 1em;
    margin: 1em;
    background-image: url('http://img.blog.myjiandan.com/concise-blog/wallhaven-13x79v%20(1).jpg')
  }


  html, body {
    margin: 0;
    height: 100%;
    width: 100%;
  }


</style>
